Skip to content

fix: console.error doesn't have to be a string in act.compat.js #476

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

rvdkooy
Copy link
Contributor

@rvdkooy rvdkooy commented Sep 3, 2019

What:
This PR fixes issue: #442 by adding type checking for args used in asyncAct function.

Why:
Current implementation assumes console.erorr was always called with a string even though it could be called with other types.

How:
Wrapped execution of code in a type check if statement to ensure operations are done only on string types.

Checklist:

  • Documentation added to the docs site N/A
  • Tests
  • Typescript definitions updated N/A
  • Ready to be merged

@rvdkooy rvdkooy mentioned this pull request Sep 3, 2019
4 tasks
@kentcdodds
Copy link
Member

I'm happy to merge either of these once they pass the build and all the current tests :)

@rvdkooy
Copy link
Contributor Author

rvdkooy commented Sep 3, 2019

actually found out that the noop scenario was never tested
the previous 100% coverage was not really 100%

Added a test for this, coverage should be 100% again

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent. Thank you!

@kentcdodds kentcdodds merged commit 139df62 into testing-library:master Sep 3, 2019
@kentcdodds
Copy link
Member

@all-contributors please add @rvdkooy for code and tests

@allcontributors
Copy link
Contributor

@kentcdodds

I've put up a pull request to add @rvdkooy! 🎉

@kentcdodds
Copy link
Member

🎉 This PR is included in version 9.1.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

AEgan added a commit to AEgan/native-testing-library that referenced this pull request Dec 12, 2019
prevents asyncAct throwing an error if the item being logged isn't a string.

Coped mostly from testing-library/react-testing-library#476
bcarroll22 pushed a commit to testing-library/native-testing-library that referenced this pull request Dec 13, 2019
prevents asyncAct throwing an error if the item being logged isn't a string.

Coped mostly from testing-library/react-testing-library#476
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants